Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.23k stars 3.84k forks source link

[Azure Spring Cloud]Enable Application Insights and log analytics for Azure Spring Cloud in PowerShell #12566

Open kyliel opened 4 years ago

kyliel commented 4 years ago

Description of the new feature

Enable Application Insights and log analytics for Azure Spring Cloud in PowerShell

  1. Go to your Azure Spring Cloud service page in the Azure portal.
  2. On the Monitoring page, select Distributed Tracing.
  3. Select Edit setting to edit or add a new setting.
  4. Create a new Application Insights query, or select an existing one.
  5. Choose which logging category you want to monitor, and specify the retention time in days.
  6. Select Apply to apply the new tracing.

How this enabling of app insights can be automated (e.g. with Powershell or terraform)? Same for Log analytics.

Submit it on behalf of top customers.

Proposed implementation details (optional)

bowen5 commented 4 years ago

For App Insights, related property in Azure Spring Cloud swagger to enable it is: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2019-05-01-preview/appplatform.json#L2298, and here is the sample: https://github.com/Azure/azure-rest-api-specs/blob/master/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2019-05-01-preview/examples/Services_CreateOrUpdate.json#L16.

For Log Analytics, the request is actually go to Diagnostic Settings service and won't go to Azure Spring Cloud. Related sample PSH is: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/diagnostic-settings#create-using-powershell. So I suppose we need to implement the same functionality in our PSH, but calling Diagnostic Settings service with Azure Spring Cloud resource id (e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice) provided.