Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to use the CLI command to : setup Azure Monitor to route sign-in and auditing logs to Log Analytics workspace #14

Open
Sachin-fadv opened this issue Aug 22, 2024 · 0 comments

Comments

@Sachin-fadv
Copy link

Not able to use command for rgDelegatedResourceManagement though it get sucessful if done through clicking on deploy button in this repo readme which open template in azure UI

image

image

Used az commands

- az deployment group create --resource-group "" --template-file rgDelegatedResourceManagement.json --parameters rg.parameters.json --verbose --subscription ""

rgDelegatedResourceManagement.json copied from https://github.com/azure-ad-b2c/siem/blob/master/templates/rgDelegatedResourceManagement.json
{ "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "mspOfferName": { "type": "string", "metadata": { "description": "Specify a unique name for your offer" }, "defaultValue": "<to be filled out by MSP> Specify a title for your offer" }, "mspOfferDescription": { "type": "string", "metadata": { "description": "Name of the Managed Service Provider offering" }, "defaultValue": "<to be filled out by MSP> Provide a brief description of your offer" }, "managedByTenantId": { "type": "string", "metadata": { "description": "Specify the tenant id of the Managed Service Provider" }, "defaultValue": "<to be filled out by MSP> Provide your tenant id" }, "authorizations": { "type": "array", "metadata": { "description": "Specify an array of objects, containing tuples of Azure Active Directory principalId, a Azure roleDefinitionId, and an optional principalIdDisplayName. The roleDefinition specified is granted to the principalId in the provider's Active Directory and the principalIdDisplayName is visible to customers." }, "defaultValue": [ { "principalId": "<Replace with group's OBJECT ID>", "principalIdDisplayName": "Azure AD B2C tenant administrators", "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c" } ] }, "rgName": { "type": "string", "defaultValue": "<Replace with Resource Group's Name e.g. az-monitor-rg>" } }, "variables": { "mspRegistrationName": "[guid(parameters('mspOfferName'))]", "mspAssignmentName": "[guid(parameters('mspOfferName'))]" }, "resources": [ { "type": "Microsoft.ManagedServices/registrationDefinitions", "apiVersion": "2019-06-01", "name": "[variables('mspRegistrationName')]", "properties": { "registrationDefinitionName": "[parameters('mspOfferName')]", "description": "[parameters('mspOfferDescription')]", "managedByTenantId": "[parameters('managedByTenantId')]", "authorizations": "[parameters('authorizations')]" } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2018-05-01", "name": "rgAssignment", "resourceGroup": "[parameters('rgName')]", "dependsOn": [ "[resourceId('Microsoft.ManagedServices/registrationDefinitions/', variables('mspRegistrationName'))]" ], "properties":{ "mode":"Incremental", "template":{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": {}, "resources": [ { "type": "Microsoft.ManagedServices/registrationAssignments", "apiVersion": "2019-06-01", "name": "[variables('mspAssignmentName')]", "properties": { "registrationDefinitionId": "[resourceId('Microsoft.ManagedServices/registrationDefinitions/', variables('mspRegistrationName'))]" } } ] } } } ], "outputs": { "mspOfferName": { "type": "string", "value": "[concat('Managed by', ' ', parameters('mspOfferName'))]" }, "authorizations": { "type": "array", "value": "[parameters('authorizations')]" } } }

rg.parameters.json
{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", "contentVersion": "1.0.0.0", "parameters": { "mspOfferName": { "value": "Relecloud Managed Services" }, "rgName": { "value": "rg-name" }, "mspOfferDescription": { "value": "Relecloud Managed Services" }, "managedByTenantId": { "value": "<TenantId>" }, "authorizations": { "value": [ { "principalId": "<principalId>", "roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c", "principalIdDisplayName": "Azure AD B2C tenant administrators" } ] } } }

Error :
image

Also run following command to use ---template-uri https://github.com/azure-ad-b2c/siem/blob/master/templates/rgDelegatedResourceManagement.json
- az deployment group create --resource-group "" --template-uri https://github.com/azure-ad-b2c/siem/blob/master/templates/rgDelegatedResourceManagement.json --parameters rg.parameters.json --verbose --subscription ""

Error :
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant