-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More updates, let's see where we are
- Loading branch information
1 parent
8856b67
commit d4db8b5
Showing
14 changed files
with
152 additions
and
80 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
docs/storage/snippets/tutorial/AspireStorage/AspireStorage.AppHost/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning", | ||
"Aspire.Hosting.Dcp": "Warning" | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning", | ||
"Aspire.Hosting.Dcp": "Warning" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
...ippets/tutorial/AspireStorage/AspireStorage.Worker/AzureClientFactoryBuilderExtensions.cs
This file was deleted.
Oops, something went wrong.
6 changes: 1 addition & 5 deletions
6
.../snippets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"dependencies": { | ||
"secrets1": { | ||
"type": "secrets" | ||
} | ||
} | ||
"dependencies": {} | ||
} |
6 changes: 1 addition & 5 deletions
6
...ets/tutorial/AspireStorage/AspireStorage.Worker/Properties/serviceDependencies.local.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
{ | ||
"dependencies": { | ||
"secrets1": { | ||
"type": "secrets.user" | ||
} | ||
} | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 60 additions & 2 deletions
62
docs/storage/snippets/tutorial/AspireStorage/AspireStorage/Components/Pages/Home.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,65 @@ | ||
@page "/" | ||
|
||
@using System.ComponentModel.DataAnnotations | ||
@using Azure.Storage.Blobs | ||
@using Azure.Storage.Queues | ||
|
||
@inject BlobServiceClient BlobClient | ||
@inject QueueServiceClient QueueServiceClient | ||
|
||
<PageTitle>Home</PageTitle> | ||
|
||
<h1>Hello, world!</h1> | ||
<div class="text-center"> | ||
<h1 class="display-4">Request Support</h1> | ||
</div> | ||
|
||
<EditForm Model="@Ticket" FormName="Tickets" method="post" | ||
OnValidSubmit="@HandleValidSubmit" enctype="multipart/form-data"> | ||
<DataAnnotationsValidator /> | ||
<ValidationSummary /> | ||
|
||
<div class="mb-4"> | ||
<label>Issue Title</label> | ||
<InputText class="form-control" @bind-Value="@Ticket.Title" /> | ||
<ValidationMessage For="() => Ticket.Title" /> | ||
</div> | ||
<div class="mb-4"> | ||
<label>Issue Description</label> | ||
<InputText class="form-control" @bind-Value="@Ticket.Description" /> | ||
<ValidationMessage For="() => Ticket.Description" /> | ||
</div> | ||
<div class="mb-4"> | ||
<label>Attachment</label> | ||
<InputFile class="form-control" name="Ticket.Document" /> | ||
<ValidationMessage For="() => Ticket.Document" /> | ||
</div> | ||
<button class="btn btn-primary" type="submit">Submit</button> | ||
</EditForm> | ||
|
||
@code { | ||
[SupplyParameterFromForm(FormName = "Tickets")] | ||
private SupportTicket Ticket { get; set; } = new(); | ||
|
||
private async Task HandleValidSubmit() | ||
{ | ||
var docsContainer = BlobClient.GetBlobContainerClient("fileuploads"); | ||
|
||
// Upload file to blob storage | ||
await docsContainer.UploadBlobAsync( | ||
Ticket.Document.FileName, | ||
Ticket.Document.OpenReadStream()); | ||
|
||
// Send message to queue | ||
var queueClient = QueueServiceClient.GetQueueClient("tickets"); | ||
|
||
await queueClient.SendMessageAsync( | ||
$"{Ticket.Title} - {Ticket.Description}"); | ||
} | ||
|
||
Welcome to your new app. | ||
private class SupportTicket() | ||
{ | ||
[Required] public string Title { get; set; } = default!; | ||
[Required] public string Description { get; set; } = default!; | ||
[Required] public IFormFile Document { get; set; } = default!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
docs/storage/snippets/tutorial/AspireStorage/AspireStorage/appsettings.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
{ | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
"Logging": { | ||
"LogLevel": { | ||
"Default": "Information", | ||
"Microsoft.AspNetCore": "Warning" | ||
} | ||
}, | ||
"AllowedHosts": "*", | ||
"ConnectionStrings": { | ||
"BlobConnection": "https://{account_name}.blob.core.windows.net/", | ||
"QueueConnection": "https://{account_name}.queue.core.windows.net/" | ||
} | ||
}, | ||
"AllowedHosts": "*" | ||
} |