|
| 1 | +# Azure CLI billing Extension # |
| 2 | +This is the extension for billing |
| 3 | + |
| 4 | +### How to use ### |
| 5 | +Install this extension using the below CLI command |
| 6 | +``` |
| 7 | +az extension add --name billing |
| 8 | +``` |
| 9 | + |
| 10 | +### Included Features ### |
| 11 | +#### billing account #### |
| 12 | +##### List ##### |
| 13 | +``` |
| 14 | +az billing account list |
| 15 | +``` |
| 16 | +##### List ##### |
| 17 | +``` |
| 18 | +az billing account list --expand "soldTo,billingProfiles,billingProfiles/invoiceSections" |
| 19 | +``` |
| 20 | +##### List ##### |
| 21 | +``` |
| 22 | +az billing account list --expand "enrollmentDetails,departments,enrollmentAccounts" |
| 23 | +``` |
| 24 | +##### Show ##### |
| 25 | +``` |
| 26 | +az billing account show --expand "soldTo,billingProfiles,billingProfiles/invoiceSections" --name "{billingAccountName}" |
| 27 | +``` |
| 28 | +##### Show ##### |
| 29 | +``` |
| 30 | +az billing account show --name "{billingAccountName}" |
| 31 | +``` |
| 32 | +##### Update ##### |
| 33 | +``` |
| 34 | +az billing account update --name "{billingAccountName}" --display-name "Test Account" \ |
| 35 | + --sold-to address-line1="Test Address 1" city="Redmond" company-name="Contoso" country="US" first-name="Test" last-name="User" postal-code="12345" region="WA" |
| 36 | +``` |
| 37 | +#### billing balance #### |
| 38 | +##### Show ##### |
| 39 | +``` |
| 40 | +az billing balance show --account-name "{billingAccountName}" --profile-name "{billingProfileName}" |
| 41 | +``` |
| 42 | +#### billing instruction #### |
| 43 | +##### Create ##### |
| 44 | +``` |
| 45 | +az billing instruction create --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 46 | + --name "{instructionName}" --amount 5000 --end-date "2020-12-30T21:26:47.997Z" \ |
| 47 | + --start-date "2019-12-30T21:26:47.997Z" |
| 48 | +``` |
| 49 | +##### Show ##### |
| 50 | +``` |
| 51 | +az billing instruction show --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 52 | + --name "{instructionName}" |
| 53 | +``` |
| 54 | +##### List ##### |
| 55 | +``` |
| 56 | +az billing instruction list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" |
| 57 | +``` |
| 58 | +#### billing profile #### |
| 59 | +##### Create ##### |
| 60 | +``` |
| 61 | +az billing profile create --account-name "{billingAccountName}" --name "{billingProfileName}" \ |
| 62 | + --bill-to address-line1="Test Address 1" city="Redmond" country="US" first-name="Test" last-name="User" postal-code="12345" region="WA" \ |
| 63 | + --display-name "Finance" --enabled-azure-plans sku-id="0001" --enabled-azure-plans sku-id="0002" \ |
| 64 | + --invoice-email-opt-in true --po-number "ABC12345" |
| 65 | +``` |
| 66 | +##### List ##### |
| 67 | +``` |
| 68 | +az billing profile list --expand "invoiceSections" --account-name "{billingAccountName}" |
| 69 | +``` |
| 70 | +##### Show ##### |
| 71 | +``` |
| 72 | +az billing profile show --account-name "{billingAccountName}" --name "{billingProfileName}" |
| 73 | +``` |
| 74 | +##### Show ##### |
| 75 | +``` |
| 76 | +az billing profile show --expand "invoiceSections" --account-name "{billingAccountName}" --name "{billingProfileName}" |
| 77 | +``` |
| 78 | +##### List ##### |
| 79 | +``` |
| 80 | +az billing profile list --account-name "{billingAccountName}" |
| 81 | +``` |
| 82 | +#### billing customer #### |
| 83 | +##### List ##### |
| 84 | +``` |
| 85 | +az billing customer list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" |
| 86 | +``` |
| 87 | +##### Show ##### |
| 88 | +``` |
| 89 | +az billing customer show --account-name "{billingAccountName}" --name "{customerName}" |
| 90 | +``` |
| 91 | +##### Show ##### |
| 92 | +``` |
| 93 | +az billing customer show --expand "enabledAzurePlans,resellers" --account-name "{billingAccountName}" \ |
| 94 | + --name "{customerName}" |
| 95 | +``` |
| 96 | +#### billing invoice section #### |
| 97 | +##### Create ##### |
| 98 | +``` |
| 99 | +az billing invoice section create --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 100 | + --name "{invoiceSectionName}" --display-name "invoiceSection1" --labels costCategory="Support" pcCode="A123456" |
| 101 | +``` |
| 102 | +##### Show ##### |
| 103 | +``` |
| 104 | +az billing invoice section show --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 105 | + --name "{invoiceSectionName}" |
| 106 | +``` |
| 107 | +##### List ##### |
| 108 | +``` |
| 109 | +az billing invoice section list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" |
| 110 | +``` |
| 111 | +#### billing permission #### |
| 112 | +##### List ##### |
| 113 | +``` |
| 114 | +az billing permission list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 115 | + --invoice-section-name "{invoiceSectionName}" |
| 116 | +``` |
| 117 | +#### billing subscription #### |
| 118 | +##### List ##### |
| 119 | +``` |
| 120 | +az billing subscription list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 121 | + --invoice-section-name "{invoiceSectionName}" |
| 122 | +``` |
| 123 | +##### Show ##### |
| 124 | +``` |
| 125 | +az billing subscription show --account-name "{billingAccountName}" |
| 126 | +``` |
| 127 | +##### Update ##### |
| 128 | +``` |
| 129 | +az billing subscription update --account-name "{billingAccountName}" --cost-center "ABC1234" |
| 130 | +``` |
| 131 | +##### Move ##### |
| 132 | +``` |
| 133 | +az billing subscription move --account-name "{billingAccountName}" \ |
| 134 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" |
| 135 | +``` |
| 136 | +##### Validate-move ##### |
| 137 | +``` |
| 138 | +az billing subscription validate-move --account-name "{billingAccountName}" \ |
| 139 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" |
| 140 | +``` |
| 141 | +##### Validate-move ##### |
| 142 | +``` |
| 143 | +az billing subscription validate-move --account-name "{billingAccountName}" \ |
| 144 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" |
| 145 | +``` |
| 146 | +#### billing product #### |
| 147 | +##### List ##### |
| 148 | +``` |
| 149 | +az billing product list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 150 | + --invoice-section-name "{invoiceSectionName}" |
| 151 | +``` |
| 152 | +##### Show ##### |
| 153 | +``` |
| 154 | +az billing product show --account-name "{billingAccountName}" --name "{productName}" |
| 155 | +``` |
| 156 | +##### Update ##### |
| 157 | +``` |
| 158 | +az billing product update --account-name "{billingAccountName}" --auto-renew "Off" --name "{productName}" |
| 159 | +``` |
| 160 | +##### Move ##### |
| 161 | +``` |
| 162 | +az billing product move --account-name "{billingAccountName}" \ |
| 163 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \ |
| 164 | + --name "{productName}" |
| 165 | +``` |
| 166 | +##### Validate-move ##### |
| 167 | +``` |
| 168 | +az billing product validate-move --account-name "{billingAccountName}" \ |
| 169 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \ |
| 170 | + --name "{productName}" |
| 171 | +``` |
| 172 | +##### Validate-move ##### |
| 173 | +``` |
| 174 | +az billing product validate-move --account-name "{billingAccountName}" \ |
| 175 | + --destination-invoice-section-id "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{newInvoiceSectionName}" \ |
| 176 | + --name "{productName}" |
| 177 | +``` |
| 178 | +#### billing invoice #### |
| 179 | +##### List ##### |
| 180 | +``` |
| 181 | +az billing invoice list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 182 | + --period-end-date "2018-06-30" --period-start-date "2018-01-01" |
| 183 | +``` |
| 184 | +##### List ##### |
| 185 | +``` |
| 186 | +az billing invoice list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 187 | + --period-end-date "2018-06-30" --period-start-date "2018-01-01" |
| 188 | +``` |
| 189 | +##### Show ##### |
| 190 | +``` |
| 191 | +az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}" |
| 192 | +``` |
| 193 | +##### Show ##### |
| 194 | +``` |
| 195 | +az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}" |
| 196 | +``` |
| 197 | +##### Show ##### |
| 198 | +``` |
| 199 | +az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}" |
| 200 | +``` |
| 201 | +##### Show ##### |
| 202 | +``` |
| 203 | +az billing invoice show --account-name "{billingAccountName}" --name "{invoiceName}" |
| 204 | +``` |
| 205 | +#### billing transaction #### |
| 206 | +##### List ##### |
| 207 | +``` |
| 208 | +az billing transaction list --account-name "{billingAccountName}" --invoice-name "{invoiceName}" |
| 209 | +``` |
| 210 | +#### billing policy #### |
| 211 | +##### Update ##### |
| 212 | +``` |
| 213 | +az billing policy update --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 214 | + --marketplace-purchases "OnlyFreeAllowed" --reservation-purchases "NotAllowed" --view-charges "Allowed" |
| 215 | +``` |
| 216 | +#### billing property #### |
| 217 | +##### Show ##### |
| 218 | +``` |
| 219 | +az billing property show |
| 220 | +``` |
| 221 | +##### Update ##### |
| 222 | +``` |
| 223 | +az billing property update --cost-center "1010" |
| 224 | +``` |
| 225 | +#### billing role-definition #### |
| 226 | +##### List ##### |
| 227 | +``` |
| 228 | +az billing role-definition list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 229 | + --invoice-section-name "{invoiceSectionName}" |
| 230 | +``` |
| 231 | +#### billing role-assignment #### |
| 232 | +##### List ##### |
| 233 | +``` |
| 234 | +az billing role-assignment list --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 235 | + --invoice-section-name "{invoiceSectionName}" |
| 236 | +``` |
| 237 | +##### Delete ##### |
| 238 | +``` |
| 239 | +az billing role-assignment delete --account-name "{billingAccountName}" --profile-name "{billingProfileName}" \ |
| 240 | + --name "{billingRoleAssignmentName}" --invoice-section-name "{invoiceSectionName}" |
| 241 | +``` |
| 242 | +#### billing agreement #### |
| 243 | +##### List ##### |
| 244 | +``` |
| 245 | +az billing agreement list --account-name "{billingAccountName}" |
| 246 | +``` |
| 247 | +##### Show ##### |
| 248 | +``` |
| 249 | +az billing agreement show --name "{agreementName}" --account-name "{billingAccountName}" |
| 250 | +``` |
| 251 | +#### billing reservation #### |
| 252 | +##### List ##### |
| 253 | +``` |
| 254 | +az billing reservation list --filter "properties/reservedResourceType eq \'VirtualMachines\'" \ |
| 255 | + --orderby "properties/userFriendlyAppliedScopeType asc" --account-name "{billingAccountName}" \ |
| 256 | + --profile-name "{billingProfileName}" --refresh-summary "true" --selected-state "Succeeded" |
| 257 | +``` |
0 commit comments