You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -71,11 +71,11 @@ If you want to manually configure your application and code sample, use the foll
71
71
3. Depending on the version of Visual Studio, you might need to right-click the project **AppModelv2-WebApp-OpenIDConnect-DotNet** and then select **Restore NuGet packages**.
72
72
4. Open the Package Manager Console by selecting **View** > **Other Windows** > **Package Manager Console**. Then run `Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r`.
73
73
74
-
5. Edit *Web.config* and replace the parameters `ClientId`, `Tenant`, and `redirectUri` with:
5. Edit *appsettings.json* and replace the parameters `ClientId`, `Tenant`, and `redirectUri` with:
75
+
```json
76
+
"ClientId":"Enter_the_Application_Id_here"/>
77
+
"TenantId": "Enter_the_Tenant_Info_Here"/>
78
+
"RedirectUri" :"https://localhost:44368/"/>
79
79
```
80
80
In that code:
81
81
@@ -100,48 +100,30 @@ This section gives an overview of the code required to sign in users. This overv
100
100
You can set up the authentication pipeline with cookie-based authentication by using OpenID Connect in ASP.NET with OWIN middleware packages. You can install these packages by running the following commands in Package Manager Console within Visual Studio:
The OWIN middleware uses a *startup class* that runs when the hosting process starts. In this quickstart, the *startup.cs* file is in the root folder. The following code shows the parameters that this quickstart uses:
@@ -155,10 +137,6 @@ public void Configuration(IAppBuilder app)
155
137
|`TokenValidationParameters`| A list of parameters for token validation. In this case, `ValidateIssuer` is set to `false` to indicate that it can accept sign-ins from any personal, work, or school account type. |
156
138
|`Notifications`| A list of delegates that can be run on `OpenIdConnect` messages. |
157
139
158
-
159
-
> [!NOTE]
160
-
> Setting `ValidateIssuer = false` is a simplification for this quickstart. In real applications, validate the issuer. See the samples to understand how to do that.
161
-
162
140
### Authentication challenge
163
141
164
142
You can force a user to sign in by requesting an authentication challenge in your controller:
@@ -182,6 +160,24 @@ public void SignIn()
182
160
183
161
You can protect a controller or controller actions by using the `[Authorize]` attribute. This attribute restricts access to the controller or actions by allowing only authenticated users to access the actions in the controller. An authentication challenge will then happen automatically when an unauthenticated user tries to access one of the actions or controllers decorated by the `[Authorize]` attribute.
184
162
163
+
### Call Microsoft Graph from the controller
164
+
165
+
You can call Microsoft Graph from the controller by getting the instance of GraphServiceClient using the `GetGraphServiceClient` extension method on the controller, like in the following code:
Copy file name to clipboardExpand all lines: articles/app-service/operating-system-functionality.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,8 @@ At its core, App Service is a service running on top of the Azure PaaS (platform
47
47
- An operating system drive (`%SystemDrive%`), whose size varies depending on the size of the VM.
48
48
- A resource drive (`%ResourceDrive%`) used by App Service internally.
49
49
50
+
A best practice is to always use the environment variables `%SystemDrive%` and `%ResourceDrive%` instead of hard-coded file paths. The root path returned from these two environment variables has shifted over time from `d:\` to `c:\`. However, older applications hard-coded with file path references to `d:\` will continue to work because the App Service platform automatically remaps `d:\` to instead point at `c:\`. As noted above, it is highly recommended to always use the environment variables when building file paths and avoid confusion over platform changes to the default root file path.
51
+
50
52
It is important to monitor your disk utilization as your application grows. If the disk quota is reached, it can have adverse effects to your application. For example:
51
53
52
54
- The app may throw an error indicating not enough space on the disk.
Using `ILogger` isthepreferredmethodinASP.NETapplicationsandisprioritizedastheloggingsourceifaninstanceof `ILoggerFactory` ispresent. However, if `ILoggerFactory` isnotavailable, logscanalternativelybeenabledandconfiguredthroughthe [instructionsfor .NETCoreapps](./enable-dynamic-configuration-dotnet-core.md#logging-and-monitoring). Formoreinformation, see [loggingin .NETCoreandASP.NETCore](/aspnet/core/fundamentals/logging).
Copy file name to clipboardExpand all lines: articles/azure-app-configuration/enable-dynamic-configuration-dotnet-core.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,47 @@ Calling the `ConfigureRefresh` method alone won't cause the configuration to ref
140
140
> [!NOTE]
141
141
> Since the cache expiration time was set to 10 seconds using the `SetCacheExpiration` method while specifying the configuration for the refresh operation, the value for the configuration setting will only be updated if at least 10 seconds have elapsed since the last refresh for that setting.
142
142
143
+
## Logging and monitoring
144
+
145
+
Logs are output upon configuration refresh and contain detailed information on key-values retrieved from your App Configuration store and configuration changes made to your application. If you have an ASP.NET Core application, see these instructions for [Logging and Monitoring in ASP.NET Core](./enable-dynamic-configuration-aspnet-core.md#logging-and-monitoring). Otherwise, you can enable logging using the instructions for [logging with the Azure SDK](/dotnet/azure/sdk/logging).
146
+
147
+
- Logs are output at different event levels. The default level is `Informational`.
148
+
149
+
| Event Level | Description |
150
+
|---|---|
151
+
| Verbose | Logs include the key and label of key-values your application monitors for changes from your App Configuration store. The information also includes whether the key-value has changed compared with what your application has already loaded. Enable logs at this level to troubleshoot your application if a configuration change didn't happen as expected. |
152
+
| Informational | Logs include the keys of configuration settings updated during a configuration refresh. Values of configuration settings are omitted from the log to avoid leaking sensitive data. You can monitor logs at this level to ensure your application picks up expected configuration changes. |
153
+
| Warning | Logs include failures and exceptions that occurred during configuration refresh. Occasional occurrences can be ignored because the configuration provider will continue using the cached data and attempt to refresh the configuration next time. You can monitor logs at this level for repetitive warnings that may indicate potential issues. For example, you rotated the connection string but forgot to update your application. |
154
+
155
+
You can enable logging at the `Verbose` event level by specifying the `EventLevel.Verbose` parameter, as done in the following example. These instructions apply to all other event levels as well. This example also enables logs for only the `Microsoft-Extensions-Configuration-AzureAppConfiguration-Refresh` category.
156
+
```csharp
157
+
using var listener = new AzureEventSourceListener((eventData, text) =>
158
+
{
159
+
if (eventData.EventSource.Name == "Microsoft-Extensions-Configuration-AzureAppConfiguration-Refresh")
- The logging category is `Microsoft-Extensions-Configuration-AzureAppConfiguration-Refresh`, which appears before each log. Here are some example logs at each event level:
0 commit comments