Closed richaplinvs closed 10 months ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
Hi @richaplinvs Thank you for using Azure SDK for .NET. It seems like you are looking at a wrong package. The correct package would be:Azure.ResourceManager.Monitor The code sample you may refer:
//Create a Diagnostic Setting
var scope = appServicePlan.Id;
var dsname = "ds1";
var diagnostSettingCollection = client.GetDiagnosticSettings(scope);
var diagnostSettingData = new DiagnosticSettingData()
{
WorkspaceId = new ResourceIdentifier(workspace.Id),
StorageAccountId = new ResourceIdentifier(storageAccount.Id),
Metrics =
{
new MetricSettings(true)
{
Category = "AllMetrics",
}
}
};
var diagnost = await diagnostSettingCollection.CreateOrUpdateAsync(WaitUntil.Completed, dsname, diagnostSettingData);
Console.WriteLine(diagnost.Value.Data.Id);
Hi @richaplinvs. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
Hi @richaplinvs, since you haven’t asked that we /unresolve
the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve
to reopen the issue.
Library name and version
Azure.ResourceManager.AppService 1.0.01, Azure.ResourceManager 1.4.0
Query/Question
I want to configure the FunctionApp to log to a Log Analytics Workspace using the Diagnostic Setting. However I can't see how to do this with the Azure.ResourceManager api.
I have created a function using the following code:
There's a
GetSiteDiagnostics()
but no equivalent Update method. There's very limited samples for this API and even looking through the source code is hard as the comments are all autogenerated seem to restate class/method names - is there some other resource that would help?Any help would be appreciated!
Environment
.Net runtime Visual Studio for Mac.