Contents
Table of Contents | ||||
---|---|---|---|---|
|
...
Expand the Access keys (access key ID and secret access key) section as shown below
Choose Create New Access Key. If this option is not available, then you already have the maximum number of access keys. You must delete one of the existing access keys before you can create a new key. For more information, see IAM Object Quotas in the IAM User Guide.
...
Navigate to Billing
Navigate to cost and usage report
Create a report based by hitting on the create report button
This will create a new report creating wizard with 3 steps to create a report that will capture all the cost and other data based on frequency of selection(Hourly, Daily and Monthly) the cost of capturing the report is free of cost.
...
In the first step, user may have to provide name of the report as given below in the screenshot for reference
In the second step need to configure either an existing bucket or create a new one to store the report. The report can be versioned or overwrite the existing one. Finally the report has to selected as a GZIP file type for our processing
...
In the final step review and complete all the details.
...
Login to Azure portal using https://portal.azure.com/
In Search box for type Azure Active Directory.
Select Tenant Id from page
If you have multiple tenants from the overview page click on Manage Tenants to get the Tenant Id of a specific tenant.If you need the Tenant Id of the default Tenant you can get it from the Overview page itself.
Anchor | ||||
---|---|---|---|---|
|
...
Login to Azure Portal if you are not already logged in.
Search for Azure Active Directory
From left Menu of Azure Directory -> click App Registration -> Click the name of the application created in the previous step.
From the left menu of selected application -> click Certificates & secrets
Click on New Client Secret from right side pane -> Add description and expiration in Add a Client Secret screen -> Click Add button.
Copy Value field, do not copy a secret key
Anchor | ||||
---|---|---|---|---|
|
...
Login to Azure Portal if you are not already logged in.
Search for Subscription
Go to Access Control
Click ADD
Go to Add Role Assignment
Select role Contributor
Go to Next tab Member
Select User, Group, Service Principle
Click on add member
Type application name that created as part of extract ClientId (Azure AD App registrations)
Click on review and assign buttonand save it
Do this activity for all Subscriptions orits parent Hierarchy
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
To configure this agent, you need following basic configuration in config. Json, in prerequisite these are already capture
"azureSubscriptionId",
"azureTenantId",
"azureClientId",
"azureSecretkey"
Thereare following section in dynamic template, user may modify these based on need, these sections are
...
To configure this agent, user need following token information
"azureSubscriptionId",
"azureTenantId",
"azureClientId",
"azureSecretkey",
"storageAccountUrl",
"storageAccountKey",
"containerName",
"storageConnectionString"
SubscriptionId
Please refer “Azure FinOps Agent with REST API” prerequisite section
...
get it from above section Security + networking -- > Access keys Key1 or any -- > Connection string
Anchor | ||||
---|---|---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
...
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|
Anchor | ||||
---|---|---|---|---|
|
Pre-requisiteAnchor isMissingRequiredParameters true
Create a service account with access to project. Save the credentials json file for the service account we need to add this json file in agent directory later.
2. Enable access to below mentioned APIs in google cloud console.
BigQuery API
BigQuery Migration API
BigQuery Storage API
Cloud Asset API
Cloud Billing API
Cloud Billing Budget API
Cloud Datastore API
Cloud Debugger API (Deprecated)
Cloud Logging API
Cloud Monitoring API
Cloud OS Login API
Cloud Resource Manager API
Cloud SQL
Cloud Storage
Cloud Storage API
Cloud Trace API
Compute Engine API
Google Cloud APIs
Google Cloud Storage JSON API
IAM Service Account Credentials API
Identity and Access Management (IAM) API
Recommender API
Service Management API
Service Usage API
3. Export Billing detailed usage report
...
4. After 24hrs validate if the billing data is getting populated in bigquery table. Please note down the name of GCP billing table we need to add it in GCP agent’s config.json file.
View file | ||
---|---|---|
|
https://stackoverflow.com/questions/66207627/api-for-getting-daily-costs-related-to-gcp
Python libraries required for GCP agent to executeAnchor isMissingRequiredParameters true
pip install db-dtypes google-api-core google-auth google-cloud-asset google-cloud-bigquery google-cloud-bigquery-storage google-cloud-billing-budgets google-cloud-core google-cloud-monitoring google-cloud-recommender google-cloud-python-client
Configure GCP Finops agentAnchor isMissingRequiredParameters true
Please update the following fields in agent’s config.json
"datasetdetails": {
"projectname": {
"datasetname": "",
"datareporttablename": ""
}
},
Enter projectname, datasetname is the name of big query dataset where the billing report is exported,
datareporttablename is the name of big query table name where billing data is present
2. "recommendationzones": [
"us-west4-b",
"us-central1-a",
"us-central1-b",
"us-central1-c",
"us-central1-f",
"us-east4-a",
"us-east4-b",
"us-east4-c"
],
Add recommended zones for which you need to get recommendations.
3. "credentials": "<path where you are placing the service account config json>”
This is the path were the service account config json is placed.