MS Graph : Get-MgPrivilegedAccess for Azure - azure

Does anybody know how the cmdlet Get-MgPrivilegedAccess works ?
What I am supposed to write for the parameter -PrivilegedAccessId ?
I try to get all the ressources with a RBAC assignment, active or elligible.
No information on the web, and Microsoft documentation is not very full.
Thanks !

I answer myself :
I use the cmdlet Get-MgPrivilegedAccessResource
with the parameter -PrivilegedAccessId : "azureResources"
and it works :)

Related

Cannot find my azure endpoint for LogQueryClient

I'm trying to access logs from my application insights from code via LogsQueryClient. In documentation I see that I would need endpoint to my azure monitor(which is logical) but I'm unable to find it in azure and when googling I had no luck finding what I need or at least didn't find something that would look to me like answer to my problem.
This is constructor I believe I should use from documentation.
Any help would be kindly appreciated thanks.
You only need the workspaceId of your Log Analytics Workspace:
Then query like this:
logsQueryClient = new LogsQueryClient(new DefaultAzureCredential());
var response = await logsQueryClient.QueryWorkspaceAsync("2c6892c2-6c05-49f8-a88c-********", "apprequests | take 10", new QueryTimeRange(TimeSpan.FromHours(1)));

Which Azure role / permission needed for command using Azure function

I've created a solution that will auto-tag all resources in Azure when they're created using the "Creator", "Date", and "Time." These work perfectly if someone creates from the web interface. Unfortunately, I use Terraform to create resources and would like it to take the terraform appid and convert it to the name using the following command.
(Get-AzADServicePrincipal -ApplicationId "123456-4564-464651651").DisplayName
Unfortunately, I get the following error, basically saying i don't have privileges to do it. Is there a list that lets me know which roles correspond to which command i need to run? I only want to allow privileges to map Service Principle App ID display name (and nothing more).
[Error] ERROR: [Authorization_RequestDenied] : Insufficient privileges to complete the operation.Exception :Type : System.ExceptionMessage : [Authorization_RequestDenied] : Insufficient privileges to complete the operation.HResult : -2146233088CategoryInfo : InvalidOperation: ({ ConsistencyLevel …ect = , Expand = }:<>f__AnonymousType5`7) [Get-AzADServicePrincipal_List], ExceptionFullyQualifiedErrorId
The solution is based on this link using Event triggers https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/tagging-azure-resources-with-a-creator/ba-p/1479819
You should you at least Application.Read.All permission , Please see the doc for more info - https://learn.microsoft.com/en-us/graph/api/serviceprincipal-get?view=graph-rest-1.0&tabs=http
Hope this helps
Thanks

Azure Consumption Usage API - Filter Not Working

I have an issue trying to filter usages for Azure Consumption, as specified in the official documentation, based on:
properties/resourceName eq '{resourceName}
The complete URI is:
$ConsumtionUsagesUri = "https://management.azure.com/subscriptions/$subId/providers/Microsoft.Billing/billingPeriods/$BillingPeriod/providers/Microsoft.Consumption/usageDetails?$expand=meterDetails,additionalProperties&$filter=properties/resourceName eq '{resourceName}'&api-version=2019-10-01"
The query returns all the results regardless of filter. Thanks everyone for your help!
This may be because your syntax is not correct. If you would like to filter by resource name, you have to follow this syntax. Please note that the case sensitivity may return different result.
properties/instanceName eq '{instanceName}'
For other syntax, please check the Azure Consumption API repo. I believe this will work with Azure Consumption API.
it will be like => ?api-version=2021-10-01&$expand=meterDetails&metric=amortizedcost&$filter=tags/Vendor eq '******'
API documentation is not correct.

Databricks and academic graph access

I am using databricks to extract data from microsoft academic graph. When I ran the query
Get affiliations
"Affiliations = MAG.getDataframe('Affiliations')
Affiliations = Affiliations.select(Affiliations.AffiliationId, Affiliations.DisplayName)
Affiliations.show(3)" given in their documentation I receive an error
"shaded.databricks.org.apache.hadoop.fs.azure.AzureException: java.lang.IllegalArgumentException: Invalid characters in hostname".
How do I resolve this issue?
Make sure you have followed this tutorial without missing any steps.
By following this tutorial, I'm able to get Affiliations as follows.
Hope this helps. Do let us know if you any further queries.
I had the same problem, I found the mistake in the key for my storage account name. There was a space at the end of the valued of the key

What is the Azure API version

I'm trying to access the result of a GET request provided by Azure, as shown in the example : https://msdn.microsoft.com/sv-se/library/azure/dn820159.aspx
My problem is that the api-version is a mandatory argument, but I have no idea about what to write inside. I'm a bit lost with the Azure Batch documentation, it doesn't seem to be complete.
I found something in an Azure webpage : https://azure.microsoft.com/en-us/documentation/articles/search-api-versions/ and the api-version was api-version=2015-02-28. However, if I try it in my browser, I have this answer : "key":"Reason","value":"The specified api version string is invalid".
Any idea of what I can put inside the api-version parameter ?
Have a look here
As the time of this writing
The version of the Batch API described here is '2016-07-01.3.1', and
using that version is recommended where possible.
Earlier versions include '2016-02-01.3.0', '2015-12-01.2.1',
'2015-11-01.2.1', '2015-06-01.2.0', '2015-03-01.1.1', and
'2014-10-01.1.0'.
So try specifying '2016-07-01.3.1'

Resources